﻿using Bible.Data.Repository;
using NUnit.Framework;
using System.Linq;

namespace Bible.Data.UnitTests.Repository_Tests
{
    [TestFixture]
    [Category("Data")]
    public class BibleRepository_should
    {
        [Test, TestCaseSource("BookTitleCases")]
        [Description(" have book with title")]
        public void _have_book_with(string title)
        {
            var repository = new BookRepository();
            var book = repository.GetByTitle(title);

            Assert.That(book, Is.Not.Null);
            Assert.That(book.Title, Is.EqualTo(title));
        }

        [Test]
        [Description(" have 66 books")]
        public void _have_66_books()
        {
            var repository = new BookRepository();
            Assert.That(repository.GetAll().Count, Is.EqualTo(66),
                "Bible should have 66 books.");
        }

        private static string[] BookTitleCases = new string[]
        {
            "Genesis",
            "1 John",
            "Revelation"
        };
    }
}